package web;

import java.util.List;

import vo.Image;
import business.ImageService;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.Preparable;

@SuppressWarnings("unchecked")
public class ImageAction implements Preparable {
	private ImageService service;
	private List<Image> images;

	public String listImage() {
		this.images = service.getAllImages();
		return Action.SUCCESS;
	}

	public String addImage() {
		service.addImage("hello xxx");
		return listImage();
	}


	public List<Image> getImages() {
		return images;
	}

	public void prepare() throws Exception {
		// if (id != null)
		// employee = service.find(id);
	}

	public void setImageService(ImageService service) {
		this.service = service;
	}

}